package com.example.dao;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.sql.Timestamp;
import java.util.List;

public interface SlowSqlInfoRepository extends JpaRepository<SlowSqlInfo, Long>, JpaSpecificationExecutor<SlowSqlInfo> {
    List<SlowSqlInfo> findSlowSqlInfoByFingerprint(String Fingerprint);
    @Query("SELECT s FROM SlowSqlInfo s WHERE " +
            "(s.updateTime >= :updateTimeThreshold) " +
            "ORDER BY s.updateTime DESC")
    List<SlowSqlInfo> findByUpdateTime(
            @Param("updateTimeThreshold") Timestamp updateTimeThreshold
    );
}
